<?php
namespace Lib;

class Conf{

    /**
     * @var array
     */
    private static $conf = [];

    /**
     * 加载配置
     * @param $file
     */
    static function load($file){
        $conf = include $file;
        self::$conf = array_merge(self::$conf, $conf);
    }

    /**
     * 获取配置
     * @param $key
     * @return null
     */
    static function get($key = ''){
        if(empty($key)){
            return self::$conf;
        }
        return isset(self::$conf[$key]) ? self::$conf[$key] : null;
    }

}